<!-- 法拍房录入新单 -->
<!--  -->
<template>
  <div class="box">
    <section class="section_one">
      <div class="title_sub prduct_bod_r">产品说明：</div>
      <ProductDescription></ProductDescription>
    </section>

    <section class="section_two">
      <div class="title_sub infro_bod_l">信息录入：</div>
      <Information ref="Information"></Information>
    </section>

    <section class="section_three">
      <div class="title_sub upload_bod_l">附件管理：</div>
      <!-- 上传组件 -->
      <Upload class="uploadStyle" ref="Uploade" :isNew="isNew"></Upload>
    </section>

    <el-button v-if="orderSaveBtn" class="tijiao" type="primary" @click="submit"
      >提交</el-button
    >
  </div>
</template>

<script>
import { checkPermiss } from "../../assets/js/utlis";
import ProductDescription from "../../components/business/ProductDescription";
import Information from "../../components/fapai/Information";
import Upload from "../../components/fapai/Upload";
export default {
  data() {
    return {
      isNew: true,
      golbalPermissions: []
    };
  },
  components: {
    ProductDescription,
    Information,
    Upload
  },

  created() {
    this.golbalPermissions = localStorage.getItem("permissions").split(",");
  },
  computed: {
    //提交录入按钮
    orderSaveBtn: function() {
      return checkPermiss("business:auction:save", this.golbalPermissions);
    }
  },
  methods: {
    submit() {
      let bStop = true;
      bStop = this.checkForm();
      if (bStop) {
        let orderNumber = this.$refs.Uploade.orderNumber;
        this.$refs.Information.validataForm(orderNumber);
      }
    },
    checkForm() {
      //上传的图片
      let uploadImg = this.$refs.Uploade.fileList;
      if (!uploadImg.length >= 1) {
        this.$message({
          message: "请上传证件照",
          type: "error"
        });
        return false;
      }
      return true;
    }
  }
};
</script>
<style lang="less" scoped></style>
